package com.app.designpattern.creation.singleton;

/**
 * USER: zjw
 * DATA: 2019/4/11 0011
 * TIME: 上午 9:27
 * 懒汉式单例模式
 */
public class LazySingleton {
    private static LazySingleton lazySingleton = null;

    private LazySingleton() {
    }

    public synchronized static LazySingleton getInstance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
